SQL Variables Vs Static Variables
Variables are used to store values which can then be passed to other processes in the Data Flow and Master Flow. Variables can be initialized from a given static value or from a given SQL expression. In the former case the initialization value is constant, while in the latter it is dynamic and resolved only at runtime.
Note: this feature is available only with an Enterprise edition license.
Initialization
When creating or editing a variable, you are able to set the initialization type by selecting 'saved value' or database query'.
- Click here to learn how to inject variables in custom columns and scripts.
- Click here to learn how to set up incremental loading with variables.
Initialize from a Saved Value
Choose this option to initialize the variable from a saved static value, or a list of static values.
Example
In this example, the variable is initialized when Income is $60,000:
Initialize from a Database Query
Choose this option to initialize the variable from an SQL expression.
Example
In this example, a Select expression was used to initialize the variable from a database query. The variable returns the productKey from the Data table:
Select "productKey" from "Data"
Next, the expression was edited so that the variable returns the productKey only where Sales exceeded $1,500:
Where "Sales" > 1500